//
//  GHAllDiaryCell.m
//  Diary
//
//  Created by lanou3g on 15/10/30.
//  Copyright © 2015年 王艺拓. All rights reserved.
//

#import "GHAllDiaryCell.h"

@implementation GHAllDiaryCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addViews];
    }
    return self;
}

- (void)addViews
{
    // 背景
    self.bg_imagV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth * 0.3, kScreenHeight * 0.27)];
    self.bg_imagV.center = CGPointMake(self.frame.size.width / 2, self.frame.size.height / 2);
    self.bg_imagV.userInteractionEnabled = YES;
    self.bg_imagV.backgroundColor = [UIColor whiteColor];
    self.bg_imagV.layer.shadowColor = [UIColor blackColor].CGColor;
    self.bg_imagV.layer.shadowOffset = CGSizeMake(3, 3);
    self.bg_imagV.layer.shadowOpacity = 0.3;
    self.bg_imagV.layer.shadowRadius = 1;
    [self.contentView addSubview:_bg_imagV];
    
    self.deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.deleteButton.frame = CGRectZero;
    self.deleteButton.center = CGPointMake(self.bg_imagV.frame.size.width/2, self.bg_imagV.frame.size.height/2);
    [self.deleteButton setImage:[UIImage imageNamed:@"trash"] forState:UIControlStateNormal];;
    self.deleteButton.alpha = 0;
    [self.contentView addSubview:self.deleteButton];
    
}

// 适配字体
- (void)fitFont
{
    if ([WYTDevicesTool iPhone320_DEVICES]) {
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        self.summaryLabel.font = [UIFont systemFontOfSize:12];
    } else if ([WYTDevicesTool iPhone4_iPhone4s]) {
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        self.summaryLabel.font = [UIFont systemFontOfSize:13];
    } else if ([WYTDevicesTool iPhone5_iPhone5s_iPhone5c]) {
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        self.summaryLabel.font = [UIFont systemFontOfSize:13];
    } else if ([WYTDevicesTool iPhone6_iPhone6s]) {
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        self.summaryLabel.font = [UIFont systemFontOfSize:13];
    } else if ([WYTDevicesTool iPhone6Plus_iPhone6sPlus]) {
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        self.summaryLabel.font = [UIFont systemFontOfSize:13];
    } else if ([WYTDevicesTool iPhoneNONE_PLUS]) {
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        self.summaryLabel.font = [UIFont systemFontOfSize:13];
    }
}


@end
